Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zip-a-folder

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zip-a-folder

Zip/Tar a complete folder into a zip/tgz file

  • 1.1.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is zip-a-folder?

The zip-a-folder npm package allows you to easily zip folders in Node.js applications. It provides a simple API to compress directories into zip files, making it useful for tasks such as creating backups, packaging files for distribution, or preparing files for upload.

What are zip-a-folder's main functionalities?

Zip a folder

This feature allows you to zip a folder by specifying the source directory and the destination zip file path. The code sample demonstrates how to use the `zip` function to compress a folder.

const { zip } = require('zip-a-folder');

async function zipFolder() {
  await zip('/path/to/source/folder', '/path/to/destination/archive.zip');
}

zipFolder();

Zip a folder with a callback

This feature allows you to zip a folder and handle the completion with a callback function. The code sample demonstrates how to use the `zip` function with a callback to handle errors and success messages.

const { zip } = require('zip-a-folder');

zip('/path/to/source/folder', '/path/to/destination/archive.zip', (err) => {
  if (err) {
    console.error('Error zipping folder:', err);
  } else {
    console.log('Folder successfully zipped');
  }
});

Other packages similar to zip-a-folder

Keywords

FAQs

Package last updated on 09 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc